package com.max.xihu.patterns.single;

/**
 * @Author: Max
 * @Date: 2020-08-25 22:33
 * @Description:懒汉式
 */
public class SingletonLH {

    private static SingletonLH instance; //太懒了，都没有new对象

    private SingletonLH(){}//私有构造方法

    //公共全局访问点
    public static SingletonLH getInstance(){

        if (instance == null){
            instance = new SingletonLH();
        }
        return instance;
    }
}
